1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and an image processing program.
2. Description of the Related Art
In recent years, owing that the functions for color DTP and word processors have been improved, not only text but complicated objects have also become easy to create. The gradation function is one of such functions often used for improving the appearance of documents. One conventional method known for creating drawing data is to create a gradation pattern beforehand, and then masking objects in correspondence with the gradation.
However, with a gradient fill shown in FIG. 30, creating a gradation pattern beforehand may be difficult, in a case where drawing is performed by defining three different colors on each end point of a triangle, and interpolating the inside thereof.
As for another method, in a case where the direction for gradation (halftoning) is horizontal, objects divided into different shades can be overlapped onto each other. This may also be performed for the vertical direction.
Nevertheless, using software, for example, to compensate the inside of the three end points in a manner shown in FIG. 30 requires large amounts of processing.
In order to solve the aforementioned problem, Japanese Patent No. 2897765 discloses a method of drawing a gradation object directly instead of drawing a gradation object through reception of PDL commands, and thus referring to a gradation adjustment table for adjusting the difference between density obtained by computation and gradation during printing.
Further, a CRT display providing high gradient can, in general, express color gradation easily, while a printer providing low gradient, on the other hand, has difficulty in outputting color gradation, especially neutral colors (colors with slight gradation). In order to overcome such difficulty, Japanese Laid-Open Patent Application No. 9-190538 discloses a method where drawing is performed by dividing a gradating portion into plural objects having a width of 2 pixels or more.
Japanese Laid-Open Patent Application No. 2001-101431 discloses a square-shaped gradient fill in which horizontal lines that have same shade are obtained, in a case where shades are different in a vertical direction, by copying a previously drawn line, so as to increase processing speed.
In the field of 3D graphics, RGB colors are distributed to the endpoints of a triangular polygon, and compensated according to a plane equation. Japanese Laid-Open Patent Application No. 11-15997 discloses a mapping process by distributing addresses of a mapping pattern to each end point of a polygon and interpolating the inside of the polygon.
Conventionally, forming a gradation pattern beforehand and masking an object according to the gradation pattern is known as a method for generating drawing data. This method, however, requires large memory space for purposes of, for example, forming large gradation patterns, or performing a masking operation.
Furthermore, it may be difficult to form a gradation pattern beforehand by employing a method of defining different colors to three endpoints of a triangle and interpolating the inside of the triangle (See gradient fill of FIG. 30).
Furthermore, gradation (halftoning) for a single direction (horizontally or vertically) can be performed by dividing gradation into objects having different shades and overlapping the objects on top of each other (e.g. FIG. 31). In this case, however, drawing process is conducted redundantly for many portions; therefore, much memory access is required.
In the aforementioned Japanese Patent No. 2897765, shades are created by performing linear conversion from the left side of an object to the right side of the object and interpolating in a horizontal direction; nevertheless, the manner of how shades are interpolated is not clearly described. Furthermore, in the case where interpolation is performed in accordance with the left and right sides of the object, the value of interpolation may change drastically when there is a change in one of the sides (as the object shown in FIG. 32); this causes a border to be noticeable at the line of the change and deteriorate image quality.
Meanwhile, in a case where a object that is targeted for drawing is rotated, for example, when intensifying the paper employed for printing or when changing the direction of the paper, the aforementioned method may cause gradation of the rotated object to be different compared to that of the object before the rotation, and thereby deteriorate image quality (This is due to the fact that the difference in gradation is not obtained by using a plane equation in accordance with all of the endpoints of the object. Therefore, the aforementioned method may lack precision in forming gradation. Further, the trapezoid employed as an example in the conventional method cannot form a plane and is unable to create gradation suitably unless it is divided into triangles). Furthermore, a gradation adjustment table is required to be provided in the RAM inside the hardware of LSI for increasing processing speed, to thereby increase the size of hardware of the LSI and its cost.
In the aforementioned Japanese Patent Laid-Open Application No. 09-190538 where gradation portion is divided into a plurality of objects in sizes of no less than 2 pixels, calculation may be simple when gradation is either in a horizontal direction or a vertical direction (although it is still necessary to perform much calculation for obtaining the slope of the sides of the respective divided objects); however, employing the aforementioned method in obtaining a gradation, for example, shown in FIG. 30, shall require too much calculation.
The aforementioned Japanese Patent Laid-Open Application No. 2001-101431 is effective only when gradation is in a single horizontal direction, and it cannot be applied to a gradient fill where three endpoints of a triangle (e.g. FIG. 30) are respectively defined with different colors.